﻿/* 2013/1/10 */
using System.Collections;
using System.Collections.Generic;

namespace Cosmos.Media.Play
{
    /// <summary>
    /// Represents a play list that contains play items.
    /// </summary>
    public class PlayList
    {
        private PlayListItemCollection _items;
        
        private PlayTreeNode _node;

        /// <summary>
        /// Initializes an new instance of PlayList class.
        /// </summary>
        public PlayList()
        {
            _items = new PlayListItemCollection(this);
        }

        public PlayList(PlayTreeNode node)
            : this()
        {
            _node = node;
        }

        /// <summary>
        /// Gets a collection containing all items in this play list.
        /// </summary>
        public PlayListItemCollection Items
        {
            get
            {
                return _items;
            }

            protected set
            {
                if (value != null)
                    _items = value;
            }
        }

        /// <summary>
        /// Gets the play tree node which contains this play list.
        /// </summary>
        public PlayTreeNode Node
        {
            get
            {
                return _node;
            }

            internal set
            {
                _node = value;
            }
        }
    }
}
